webhook
成功提交 SCR 查询申请后,其余流程由 QI Tech 负责。操作结果通过 Webhook 跟踪,遵循预先设定的流程。标准为:成功时发送包含查询数据的 Webhook;失败时发送通知申请被拒绝的 Webhook。此外,客户在签约时可以选择查询数据仅以 PDF 格式交付,还是以完整格式交付——完整格式除了 PDF 外,还以 JSON 格式返回所有查询数据。此时客户还会收到单个 SCR 查询的密钥 SCR_KEY。
成功示例
仅 PDF 查询:
{
"data": {
"consent_term": "https://urldasassinaturas.com/assinaturas.zip",
"consulted_at": "2020-05-08",
"created_at": "2020-05-08",
"origin_key": OPERATION_KEY,
"report_end_date": "2020-03",
"report_start_date": "2019-02",
"result_document": "https://urldodocumento.com/documento_consulta.pdf",
"scr_key": SCR_KEY,
"scr_status": "consulted",
"signers": [
{
"document_number": "41184562067",
"email": "joao.ninguem@yopmail.com",
"name": "Joao Ninguem",
}
],
"subject_document_number": "41184562067",
"subject_name": "Joao Ninguem",
"subject_person_type": "natural",
},
"webhook_type": "scr",
"event_datetime": EVENT_DATE_TIME,
"status": "consulted",
"key": OPERATION_KEY,
}
完整查询:
{
"data":{
"consent_term":"https://urldasassinaturas.com/assinaturas.zip",
"consulted_at":"2020-05-08",
"created_at":"2020-05-08",
"origin_key": OPERATION_KEY,
"report_end_date":"2020-03",
"report_start_date":"2019-02",
"result_document":"https://urldodocumento.com/documento_consulta.pdf",
"scr_key": SCR_KEY,
"scr_status":"consulted",
"scr_data":[
{
"reference_date":"2020-03",
"financial_institution_count":"3",
"operation_count":"10",
"assumed_coobligation":"10235",
"receive_coobligation":"23569",
"start_relationship":"2000-05-01",
"disagreement_operation_count":"2",
"disagreement_operation_value":"523",
"subjudice_operations_count":"1",
"subjudice_operations_value":"10000",
"indirect_risk":"200000",
"error":{
"error_code":"",
"description":"",
"error_type":""
},
"operation_items":[
{
"due_value": "46800",
"exchange_variation": "N",
"category_sub":{
"category":{
"category_code": 2,
"category_description": "Empréstimos"
},
"category_sub_code": 3,
"description": "crédito pessoal - sem consignação em folha de pagam."
},
"due_type":{
"due_type_group": "Vencido",
"due_code": "205",
"description": "Créditos vencidos de 1 a 14 dias",
}
}
]
}
],
"signers":[
{
"document_number":"41184562067",
"email":"joao.ninguem@yopmail.com",
"name":"Joao Ninguem"
}
],
"subject_document_number":"41184562067",
"subject_name":"Joao Ninguem",
"subject_person_type":"natural"
},
"webhook_type":"scr",
"event_datetime": EVENT_DATE_TIME,
"status":"consulted",
"key": OPERATION_KEY
}
含代表人的查询:
{
"data":[
{
"consent_term":"https://urldasassinaturas.com/assinaturas.zip",
"consulted_at":"2020-08-12",
"created_at":"2020-08-12",
"origin_key": OPERATION_KEY,
"report_end_date":"2019-07",
"report_start_date":"2019-06",
"result_document":"https://urldodocumento.com/documento_consulta.pdf",
"scr_key": SCR_KEY,
"scr_status":"consulted",
"signed_at":"2020-08-12",
"signers":[
{
"document_number":"00152300074",
"email":"joao.ninguem@yopmail.com",
"name":"João Almeida"
}
],
"subject_document_number":"97381542000193",
"subject_name":"Beazini Pizzas",
"subject_person_type":"legal"
},
{
"consent_term":"https://urldasassinaturas.com/assinaturas.zip",
"consulted_at":"2020-08-12",
"created_at":"2020-08-12",
"origin_key":OPERATION_KEY,
"report_end_date":"2019-07",
"report_start_date":"2019-06",
"result_document":"https://urldodocumento.com/documento_consulta.pdf",
"scr_key":SCR_KEY,
"scr_status":"consulted",
"signed_at":"2020-08-12",
"signers":[
{
"document_number":"00152300074",
"email":"joao.ninguem@yopmail.com",
"name":"João Almeida"
}
],
"subject_document_number":"00152300074",
"subject_name":"João Almeida",
"subject_person_type":"natural"
}
],
"webhook_type":"scr",
"event_datetime":"EVENT_DATE_TIME",
"status":"consulted",
"key": OPERATION_KEY
}
失败示例
{
"data": {
"consent_term": null,
"consulted_at": "2020-05-08",
"created_at": "2020-05-08",
"origin_key": OPERATION_KEY,
"report_end_date": "2020-03",
"report_start_date": "2019-02",
"result_document": null,
"scr_key": SCR_KEY,
"scr_status": "rejected",
"signers": [
{
"document_number":"41184562067",
"email":"joao.ninguem@yopmail.com",
"name":"Joao Ninguem"
}
],
"subject_document_number": "41184562067",
"subject_name": "Joao Ninguem",
"subject_person_type": "natural",
},
"webhook_type": "scr",
"event_datetime": EVENT_DATE_TIME,
"status": "rejected",
"key": OPERATION_KEY,
}